package com.linked.basemanage.feedback.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.linked.basemanage.feedback.bean.param.FeedBackPageParam;
import com.linked.basemanage.feedback.bean.po.FeedBackInfoPO;
import com.linked.basemanage.feedback.bean.vo.FeedBackVO;
import com.linked.basemanage.feedback.mapper.IFeedBackInfoMapper;
import com.linked.basemanage.feedback.service.IFeedBackService;
import org.springframework.stereotype.Service;

@Service
public class FeedBackServiceImpl implements IFeedBackService {

    private final IFeedBackInfoMapper feedBackInfoMapper;

    public FeedBackServiceImpl(IFeedBackInfoMapper feedBackInfoMapper) {
        this.feedBackInfoMapper = feedBackInfoMapper;
    }

    @Override
    public boolean addFeedBack(FeedBackInfoPO info) throws Exception {
        return feedBackInfoMapper.insert(info) > 0;
    }

    @Override
    public IPage<FeedBackVO> queryFeedBackPage(FeedBackPageParam param) throws Exception {
        return feedBackInfoMapper.queryFeedBackPage(param);
    }

    @Override
    public boolean relveFeedBack(FeedBackInfoPO info) throws Exception {
        return feedBackInfoMapper.updateById(info) > 0;
    }
}
